package jgl.vajra.kingkong.part.home.model;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import jgl.vajra.kingkong.bean.CityChoiceBean;
import jgl.vajra.kingkong.bean.HomeCarModelBean;
import jgl.vajra.kingkong.bean.HomeMechanicsBean;
import jgl.vajra.kingkong.bean.MarketPriceBean;
import jgl.vajra.kingkong.bean.OpenCityBean;
import jgl.vajra.kingkong.bean.SpeechInfoBean;
import jgl.vajra.kingkong.part.home.contract.HomePageContract;
import jgl.vajra.kingkong.widget.manager.RxJavaHttpManager;
import jgl.vajra.kingkong.widget.manager.retrofit.RetrofitJsonManager;

public class HomePageModel extends HomePageContract.Model {
    @Override
    public Observable<SpeechInfoBean> getSpeechInfoData(Map<String, Object> map) {
        return RetrofitJsonManager.getInstance().getApiService().getSpeechInfoData(map)
                .compose(RxJavaHttpManager.applyTransformer());
    }

    @Override
    public Observable<List<HomeMechanicsBean>> getCarTypeData(Map<String, Object> map) {
        return RetrofitJsonManager.getInstance().getApiService().getCarTypeData(map)
                .compose(RxJavaHttpManager.applyTransformer());
    }

    @Override
    public Observable<List<HomeCarModelBean>> getCarModelData(Map<String, Object> mapCarModel) {
        return RetrofitJsonManager.getInstance().getApiService().getCarModelData(mapCarModel)
                .compose(RxJavaHttpManager.applyTransformer());
    }

    @Override
    public Observable<MarketPriceBean> getMarketPriceData(Map<String, Object> map) {
        return RetrofitJsonManager.getInstance().getApiService().getMarketPriceData(map)
                .compose(RxJavaHttpManager.applyTransformer());
    }

    @Override
    public Observable<List<CityChoiceBean>> getAreaInfoData(Map<String, Object> map) {
        return RetrofitJsonManager.getInstance().getApiService().getAreaInfoData(map)
                .compose(RxJavaHttpManager.applyTransformer());
    }

    @Override
    public Observable<OpenCityBean> getOpenCityData(Map<String, Object> map) {
        return RetrofitJsonManager.getInstance().getApiService().getOpenCityData(map)
                .compose(RxJavaHttpManager.applyTransformer());
    }
}
